package test2.controller;

import test2.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Component
public class UserController {
    @Autowired
    private IUserMapper iUserMapper;
    public void start() {
        System.out.println("start");
        System.out.println("请选择要执行的操作:1.注册 2.登录 3.其他");
        Scanner scanner = new Scanner(System.in);
        int num = Integer.parseInt(scanner.nextLine());
        switch (num) {
            case 1:
                regUser();
                break;
            case 2:
                loginUser();
                break;
            default:
                System.out.println("其他功能还在完善中，目前404");
        }
    }

    public void regUser() {
        System.out.println("开始处理用户注册");
        iUserMapper.insert(null);
    }

    public void loginUser() {
        System.out.println("开始处理用户登录");
    }

}
